Socket
Socket
Sign inDemoInstall

hosted-git-info

Package Overview
Dependencies
Maintainers
5
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hosted-git-info

Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab


Version published
Weekly downloads
49M
increased by1.79%
Maintainers
5
Weekly downloads
 
Created

What is hosted-git-info?

The hosted-git-info npm package is a utility for working with Git repository metadata. It allows you to parse and transform various Git repository URLs into a normalized format, extract specific parts of the URL, and generate URLs for different purposes such as cloning or browsing the repository.

What are hosted-git-info's main functionalities?

Parsing Git URLs

This feature allows you to parse a Git URL and extract components such as domain, type, user, and project.

const hostedGitInfo = require('hosted-git-info');
const info = hostedGitInfo.fromUrl('https://github.com/npm/hosted-git-info.git');
console.log(info.domain); // 'github.com'
console.log(info.type); // 'github'
console.log(info.user); // 'npm'
console.log(info.project); // 'hosted-git-info'

Generating URLs

This feature enables you to generate various URLs for browsing, cloning, or as HTTPS URLs from a parsed Git repository object.

const hostedGitInfo = require('hosted-git-info');
const info = hostedGitInfo.fromUrl('git+https://github.com/npm/hosted-git-info.git');
console.log(info.browse()); // 'https://github.com/npm/hosted-git-info'
console.log(info.https()); // 'https://github.com/npm/hosted-git-info.git'

Shortcut URLs

This feature allows you to generate shortcut URLs for quick access to the repository on supported Git hosts.

const hostedGitInfo = require('hosted-git-info');
const info = hostedGitInfo.fromUrl('github:npm/hosted-git-info');
console.log(info.shortcut()); // 'github:npm/hosted-git-info'
console.log(info.https()); // 'https://github.com/npm/hosted-git-info.git'

Other packages similar to hosted-git-info

Keywords

FAQs

Package last updated on 04 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc